{extend name='base' /}
{block name='title'}个人中心{/block}
{block name='main'}
<link rel="stylesheet" href="__CSS__/booklist.css">
<link rel="stylesheet" href="__CSS__/booktable.css">
<style>
    .main {
        background: url("__IMG__/list_bg.jpg") left top repeat-y;
    }
</style>
<div class="row m-0 mt-3 main">
    {include file='user/user_left'}
    <div class="right flex-1 mb-3">
        <table class="tb w-100">
            <thead>
            <tr>
                <th colspan="2">商品信息</th>
                <th>单价</th>
                <th>数量</th>
                <th>状态</th>
            </tr>
            </thead>
            <tbody>
            {foreach $orderinfo as $ks => $v}
            <tr>
                <td width="70">
                    <img src="{$v['thumb']}" class="book-img">
                </td>
                <td><a href="{:url('Book/info', array('bookid' => $v['bookid']))}">{$v['bname']}</a></td>
                <td>￥{$v['price']}</td>
                <td>{$v['number']}</td>
                <td>
                    {if $order['status'] == 1}
                    <span class="text-danger">待发货</span>
                    {elseif $order['status'] == 2}
                    <span class="text-info">待收货</span>
                    {else}
                    <span class="text-success">已完成</span>
                    {/if}
                </td>
            </tr>
            {/foreach}
            <tr>
                <td colspan="4" class="text-right">订单总额：</td>
                <td>￥{$order['amount']}</td>
            </tr>
            {if $order['fee_name']}
            <tr>
                <td colspan="4" class="text-right">{$order['fee_name']}：</td>
                <td>￥{$order['fee']}</td>
            </tr>
            {/if}
            <tr>
                <td colspan="4" class="text-right">实付金额：</td>
                <td class="text-danger">￥{$order['amount'] + $order['fee']}</td>
            </tr>
            </tbody>
        </table>
        <div class="tt">
            快递信息
        </div>
        <table cellspacing="0" class="tb w-100">
            <tbody>
            <tr>
                <td class="tl">地址</td>
                <td>{$order['address']}</td>
            </tr>
            <tr>
                <td class="tl">姓名</td>
                <td>{$order['truename']}</td>
            </tr>
            <tr>
                <td class="tl">手机</td>
                <td>{$order['mobile']}</td>
            </tr>
            </tbody>
        </table>
        <div class="tt">
            订单详情
        </div>
        <table cellspacing="0" class="tb w-100">
            <tbody>
            <tr>
                <td class="tl">订单编号</td>
                <td>{$order['id']}</td>
            </tr>
            <tr>
                <td class="tl">下单时间</td>
                <td>{$order['date_entered']}</td>
            </tr>
            <tr>
                <td class="tl">最后更新</td>
                <td>{$order['update_entered']}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
{/block}

{block name='js'}
<script>
    function delOrder(id) {
        common("你确定要删除该订单吗？", "{:url('Order/del')}?id="+id);
    }

    function finishOrder(id) {
        common("你确定要完成该订单吗？", "{:url('Order/finish')}?id="+id);
    }
</script>
{/block}